package com.rabbit.work.contoller;


import com.rabbit.work.po.Order;
import com.rabbit.work.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class PayController {

    @Autowired
    private IOrderService orderService;

    @RequestMapping("/pay/{orderNo}")
    public String payOrder(@PathVariable("orderNo") String orderNo, Model model) {

        Order order = new Order();
        order.setOrderNo(orderNo);

        orderService.payOrder(order);
        model.addAttribute("orderNo", orderNo);
        return "pay_success";
    }

}
